package day03;

public class OperDemo1 {
    public static void main(String[] args) {
        int a1 =1,b1,c1,d1;
        b1 = a1++;//先赋值再自增
        c1 = ++a1;//先自增在赋值
        System.out.println("b1="+b1+",c1="+c1);

        int a =5,b =10,c =5;
        boolean b2 = a>b;
        System.out.println(b2);
        System.out.println(c<b);
        System.out.println(c++>5);//false
        System.out.println(c++>5);//true

        b2 = b >a && b<c;
        System.out.println(b2);
        System.out.println("c的值为--->"+c);
        boolean b3 = a>b && c++>7;
        System.out.println(b3+" "+c);//这里值得注意一下，发生短路了 后面不执行

        boolean b4 = a<b||c++>7;
        System.out.println(b4+" "+c);//true,同理也是发生短路了

        short s = 10;
//        s = s+10;会报错 因为默认运算的时候为int
        s +=10;//这样就不会，因为自带强转

        //字符串
//        System.out.println("请输入您的姓名");
//        Scanner sc = new Scanner(System.in);
//        String userName = sc.next();
//        System.out.println("请输入您的年龄");
//        int age = sc.nextInt();
//        System.out.println("您的姓名是:"+userName+"\n年龄："+age);

//        遇到字符串自动向上转型
        System.out.println(10+20+""+11);

//        三目运算符
        int para1 = 3,para  =6;
        int max = para>para1?para:para1 ;
        System.out.println(max);
    }
}
